$(function() {
    ArticleDetail();


});


function ArticleDetail() {
    var url = location.search; //获取url中"?"符后的字串
    var str = url.substr(1); //从第一个字符开始 因为第0个是?号 获取所有除问号的所有符串

    // console.log(str,url)
    $.ajax({
        url: host + "/article_detail/" + str ,
        method: "get",
        // data: params,
        contentType: "application/json",
        xhrFields: {
            withCredentials: true
        },
        success: function (resp) {
            // location.href = './my_article.html';
            var case_list = eval(resp);
            // console.log(case_list)
            for (var i in case_list){
                $("#article_name").html(case_list[i].article_name)
                $("#article_name1").html(case_list[i].article_name)
                $("#article_author").html(case_list[i].users_id)
                $("#article_text").html(case_list[i].article_text)
                $("#article_classify").html(case_list[i].article_classify)
                $("#article_time").html(case_list[i].update_time.substring(0,16))
            }

        },
        error: function (resp) {
            alert('服务器异常,请重试！')
        }
    })
}